void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  PerSetup();
}

void loop() {
  // put your main code here, to run repeatedly:
  PerLoop();
}

//人体感应
void PerSetup() {
  pinMode(12, OUTPUT);
  pinMode(A5, INPUT);
}
void PerLoop() {
  Serial.println(digitalRead(A5));
  if (digitalRead(A5) >= 1) {
    digitalWrite(12, HIGH);
    delay(2000);
  } else {
    digitalWrite(12, LOW);
  }
  delay(100);
}


//红绿灯
int color[] = {5, 6, 7};
void LEDSetup() {
  for (int i = color[0]; i < 8; i++) {
    pinMode(i, OUTPUT);
  }
}
void LEDLoop() {
  for (int i = color[0]; i < 8; i++) {
    digitalWrite(i, HIGH);
    delay(5000);
    digitalWrite(i, LOW);
  }
}
